package com.ruoyi.common.enums;

/**
 * 职级层次
 */
public enum PersonLevel
{
    LAW("law_enforcement", "执法勤务类"),
    MANAGEMENT("general_management", "综合管理类"),
    SKILLS("police_skills", "警务技术类");

    private final String code;
    private final String info;

    PersonLevel(String code, String info)
    {
        this.code = code;
        this.info = info;
    }

    public String getCode()
    {
        return code;
    }

    public String getInfo()
    {
        return info;
    }


    public static PersonLevel organTypeOf(String code) {
        for(PersonLevel actionEnum : values()){
            if(actionEnum.getCode().equals(code)){
                return actionEnum;
            }
        }
        throw new RuntimeException("没有找到对应的枚举");
    }
}
